<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
cfc('core')->checklogin();
$_RQ['op']=$_RQ['op']?$_RQ['op']:'seed';
$return=array();
$return['diy']=$this->plugin_setting('diy');
$return['setting']=$this->plugin_setting('basic');
//未种植的种子
if($_RQ['op']=='seed'){
	$params=array(
		'uniacid'=>$_SESSION['uniacid'],
		'mid'=>$_SESSION['uid'],
		'sum >'=>0
	);
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$list=pdo_getslice('jy_farmer_myseed',$params,array($pindex,$psize),$total,array(),'','createtime desc');
	if($list){
		foreach($list as &$item){
			$seed=pdo_get('jy_farmer_seed',array('uniacid'=>$_SESSION['uniacid'],'id'=>$item['seed_id']));
			$seed['image']=tomedia($seed['image']);
			$item['seed']=$seed;
			$item['order']=pdo_get('jy_farmer_order',array('uniacid'=>$_SESSION['uniacid'],'id'=>$item['order_id']));
			$item['isarea']=pdo_getsum('jy_farmer_plant_log',array('uniacid'=>$_SESSION['uniacid'],'myseed_id'=>$item['id']),'plantarea');
		}
	}
	$return['list']=$list;
	exi($return);
}
